/*
 * Copyright (c) 2018.
 * This file was written by Fancyears·Milos·Malvis @connor. Any question/bug you can't post to 1243093366@qq.com.
 * ALL RIGHTS RESERVED.
 */
package org.fancyears.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author: Fancyears·Milos·Malvis
 * @CreateDate: 2019年1月17日 上午10:44:25
 * @Description: 拦截操作，接收一个目标对象，代理的时候直接调用对象的方法
 */

public class ServiceInvocation implements InvocationHandler {
	/** 目标对象,干活的是这东西 */
	private Object target;

	public ServiceInvocation(Object target) {
		this.target = target;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		return method.invoke(target, args);
	}

}
